using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Collections;

namespace Pixels.DataLayer
{
    internal abstract class DbHelper
    {
       
        public DbHelper(string ConnectionString)
        {          
        }

        #region Abstract Methods
        public abstract int ExecuteNonQuery(string storedProcedure,out ArrayList outputValues,params object[] parameterValues);
        public abstract int ExecuteNonQuery(string storedProcedure, params object[] parameterValues);
        public abstract int ExecuteNonQuery(string commandText,CommandType commandType);

        public abstract IDataReader ExecuteReader(string commandText, params object[] parameterValues);
        public abstract IDataReader ExecuteReader(string commandText, CommandType commandType);

        public abstract DataSet ExecuteDataSet(string storedProcedure, params object[] parameterValues);
        public abstract DataSet ExecuteDataSet(string commandText, CommandType commandType);
        #endregion

        #region Virtual Methods
        protected virtual object[] AssignDBNull(params object[] parameterValues)
        {
            object[] temp = new object[parameterValues.Length];
            for (int i = 0; i < parameterValues.Length; i++)
            {
                if ((parameterValues[i] != null) && (parameterValues[i].ToString() != ""))
                {
                    temp[i] = parameterValues[i];
                }
                else
                {
                    temp[i] = DBNull.Value;
                }
            }
            return temp;
        }
        #endregion

    }
}
